import request from '@/utils/request'

// 查询校工信息
export function getSchoolWorker (data) {
  return request({
    url: '/merchantAdmin/getPageList',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 新增校工信息
export function addSchoolWorker (data) {
  return request({
    url: '/merchantAdmin/save',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 修改校工信息
export function updateSchoolWorker (data) {
  return request({
    url: '/merchantAdmin/update',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 导入校工信息
export function uploadSchoolWorker (data) {
  return request({
    url: '/merchantAdmin/upload',
    method: 'post',
    data: data,
    headers: {
      'Content-Type': 'multipart/form-data',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 导出校工信息
export function exportSchoolWorker (data) {
  return request({
    url: '/merchantAdmin/export',
    method: 'post',
    data: data,
    responseType: 'blob',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}

// 下载校工信息模板
export function downLoadExcel (data) {
  return request({
    url: '/merchantAdmin/downLoadExcel',
    method: 'post',
    data: data,
    responseType: 'blob',
    headers: {
      'Content-Type': 'application/json',
      'Authorization': window.localStorage.getItem('token'),
    }
  })
}